package testClasses.misc;

import gameAppLayer.GameSettings;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

import stars.enums.StarSystemDistributions;
import stars.enums.StarSystemNames;
import stars.starSystems.StarSystemController;
import stars.starSystems.StarSystemGenerator;
import testClasses.ATest;
import testClasses.TestingSystem;
import utilities.Key;
import controller.AbstractController;

/*
 * Generate a single starSystem object, uses XStream to save the object to an XML file.  Loads object back from XML file and confirms all data saved/loaded
 */
public class StarSystemLoadSaveTest extends ATest {

	private static final Logger logger = Logger.getLogger(StarSystemLoadSaveTest.class.getName());
	
	public StarSystemLoadSaveTest(TestingSystem system) {
		super(system);
		this.name = "StarSystemLoadSaveTest";
	}

	@Override
	public boolean execute() throws FileNotFoundException, IOException,
			ClassNotFoundException {
		
		logger.log(Level.INFO, "Execute()");
		
		HashMap<Key, AbstractController> controllerMap = new HashMap<Key, AbstractController>();
		eventManager.addControlMapReference(controllerMap);
		
		TestGameSettingsDefaults defaults = new TestGameSettingsDefaults(xmlData);
		GameSettings settings = defaults.settings;
		
		StarSystemDistributions sysDists = xmlData.getStarSystemDistributions();
		StarSystemNames sysNames = xmlData.getStarSystemNames();
		
		StarSystemGenerator sysGen = new StarSystemGenerator(settings, assetManager, eventManager, sysDists, sysNames);
		
		ArrayList<Integer> location = new ArrayList<Integer>();
		location.add(0); location.add(0); location.add(0);
		
		StarSystemController sysController = sysGen.createStarSystem(location);
		
		
		
		
		
		return false;
	}

}
